{% extends "homepage.html" %}

{% block content %}

<script>

jQuery.fn.dataTableExt.oSort['nTt-asc']  = function(x,y) {
  var in1 = x;
  var in2 = y;
  var s1 = in1.split("T");
  var s2 = in2.split("T");
  s1[0] = parseInt(s1[0]); s2[0] = parseInt(s2[0]);
  s1[1] = parseInt(s1[1]); s2[1] = parseInt(s2[1]);
  return ((s1[0] < s2[0]) ? -1 : ((s1[0] > s2[0]) ?  1 : 
    ((s1[1]<s2[1]) ? -1 : ((s1[1]>s2[1]) ? 1 : 0))));
};

jQuery.fn.dataTableExt.oSort['nTt-desc']  = function(x,y) {
  var in1 = x;
  var in2 = y;
  var s1 = in1.split("T");
  var s2 = in2.split("T");
  s1[0] = parseInt(s1[0]); s2[0] = parseInt(s2[0]);
  s1[1] = parseInt(s1[1]); s2[1] = parseInt(s2[1]);
  return ((s1[0] < s2[0]) ? 1 : ((s1[0] > s2[0]) ?  -1 : 
    ((s1[1]<s2[1]) ? 1 : ((s1[1]>s2[1]) ? -1 : 0))));
};

 $(document).ready(function() {
     $('#groupTab').dataTable({
       "bFilter":false, 
       "bAutoWidth":false, 
       "iDisplayLength":20, 
       "aoColumns": [ {"sType": "nTt"},null, null,null,null],
       "aoColumns": [ null,null, null,null,null],
       "aaSorting": [[0, 'asc']],
        "oLanguage": {
                "oPaginate": {
                        "sPrevious": "",
                        "sNext": ""
                }
        },
       "aLengthMenu": [[20, 50, -1], [20, 50, "All"]],
       "fnRowCallback": function( row, data, index ){ 
             MathJax.Hub.Queue(['Typeset', MathJax.Hub, row]);
             return row;
         }
     });
 });
</script>


<form>
<table border="0">

<tr>
<td align=left> 
{{KNOWL('gg.degree',title='Degree')}}<td align=left> <input type='text' name='n' size=3 value="{{info.n}}">
</td>

<td align=left> 
{{KNOWL('gg.tnumber',title='$t$')}} :
<td align=left> <input type="text" name="t" size="3" value="{{info.t}}" ></td>
</tr>
<tr>
<td align=left colspan="2"> 
<button type='submit' value='refine'>Search again</button>
</td></tr>
</table>
</form>


<h2> Results: ({{info.report}}) </h2>

<table border=1 cellpadding=5 class="ntdata" id="groupTab">
<thead>
<tr>
<th>Label</th>
<th>Name</th>
<th>Order</th>
<th>Parity</th>
<th>Solvable</th>
</tr>
</thead>
<tbody>

{% for group in info.groups: %}
<tr>
<td><a href="/GaloisGroup/{{group.label}}">{{group.label}}</a></td>
<td>{{info.group_display([group.n, group.t])}}</td>
<td align="right">{{group.order}}</td>
<td align="right">{{group.parity}}</td>
<td align="center">{{info.yesno(group.solv)}}</td>
</tr>

{% endfor %}

</tbody>
</table>



{% endblock %}
